package day04.ZuoYeDemo;//3. Guessing猜数字之while版：
import java.util.Scanner;
public class GuessingWhileDemo {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        int num = (int)(Math.random()*2000000000+1);
        System.out.println("小游戏：随机猜一猜");
        System.out.println("请输入数字：");
        int Guess = scan.nextInt();
        while (num!=Guess){
            if (num<Guess){
                System.out.println("猜大了");
                System.out.println("再接再厉.");
            }else {
                System.out.println("猜小了");
                System.out.println("再接再厉.");
            }
            Guess = scan.nextInt();
        }
        System.out.println("猜对了呢,你可真聪明");
    }
}
